﻿using System;
using System.Collections.Specialized;

namespace Dogshow.Web.Utils
{
    public static class Extensions
    {
         public static int? GetIntFromParameter(this NameValueCollection collection, string name)
         {
             string value = collection[name];
             if (String.IsNullOrEmpty(value)) return null;
             int intVal;
             if (!Int32.TryParse(value, out intVal))
             {
                 return null;
             }
             return intVal;
         }
    }
}